﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VSmityukh.WP.TitleLocalizationTool
{
	internal class LocalizationInfo
	{
		private readonly string applicationName;
		private readonly string applicationDescription;
		private readonly LanguageInfo defaultLanguageInfo;
		private readonly ReadOnlyCollection<LanguageInfo> languageInfos;

		public LocalizationInfo(string applicationName, string applicationDescription, IList<LanguageInfo> languageInfos)
		{
			Guard.NotNull(languageInfos);

			this.applicationName = applicationName ?? "";
			this.applicationDescription = applicationDescription ?? "";
			this.languageInfos = new ReadOnlyCollection<LanguageInfo>(languageInfos.ToArray());
			this.defaultLanguageInfo = this.languageInfos.FirstOrDefault(li => li.LanguageName == "Default");
		}

		public string ApplicationName
		{
			get { return applicationName; }
		}

		public string ApplicationDescription
		{
			get { return applicationDescription; }
		}

		public LanguageInfo DefaultLanguageInfo
		{
			get { return defaultLanguageInfo; }
		}

		public ReadOnlyCollection<LanguageInfo> LanguageInfos
		{
			get { return languageInfos; }
		}
	}
}
